<template>
  <view class="search-container" :style="{backgroundColor: bgcolor}"  @click="mySearchClick">
    <view class="search-box" :style="{'border-radius': radius+'px'}">
      <uni-icons type="search"></uni-icons>
      <text class="search-text">搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    data() {
      return {
        
      };
    },
    props: {
      bgcolor: {
        type: String,
        default: '#c00000'
      },
      radius: {
        type: Number,
        default: 36
      }
    },
    methods: {
      mySearchClick(e){
        console.log('mySearchClick')
        // 跳转
        this.$emit('click', {xxx: 'xxx'})
      }
    }
    
  }
</script>

<style lang="scss">
  .search-container {
    // background-color: #c00000;
    height: 50px;
    padding: 0px 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    .search-box {
      background-color: #ffffff;
      height: 36px;
      width: 100%;
      // border-radius: 40px;
      display: flex;
      justify-content: center;
      align-items: center;
      .search-text {
        margin-left: 16rpx;
      }
    }
  }

</style>
